
public class ListNode {

    int value;

    ListNode next;

    public ListNode(int value) {
        this.value = value;
    }

    // 打印单链表
    public void print(){
        ListNode temp = this;
        while(temp!=null){
            System.out.print(temp.value + " ");
            temp = temp.next;
        }
        System.out.println();
    }

}
